﻿using GiteeFirstProject.EntityFramwork.Models;
using Microsoft.AspNetCore.Mvc;

namespace GiteeFirstProject.Web.Host.Controllers
{
    public class HomeController : Controller
    {
        private readonly IStudentRepository studentRepository;

        public HomeController(IStudentRepository studentRepository)
        {
            this.studentRepository = studentRepository;
        }

        public IActionResult Index()
        {
            var student = new Student()
            {
                Id = System.Guid.NewGuid(),
                StuAge = 17,
                StuName = "Steven",
                StuNum = "No122"
            };
            studentRepository.Create(student);
            return View();
        }
    }
}
